package com.fg.pro.ai.AiController;

import com.fg.pro.model.reponse.ResponseResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.ai.ollama.OllamaChatModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "aiOllama",description = "ai_aiOllama")
@RestController
@RequestMapping("aiOllama")
public class AiOllamaController {

    @Autowired
    OllamaChatModel ollamaChatModel;

    @Operation(summary = "阻塞模式回答",description = "")
    @GetMapping("/chartByBlock")
    public ResponseResult chartByBlock(@RequestParam(required = false)String question){
        String call = ollamaChatModel.call(question);
        return ResponseResult.okResult(call);
    }

}
